package cn.mavor.day0903;

import java.util.Arrays;

public class dumplicates {
    public static void main(String[] args){
        int[] num = {1,2,5,4,9,7,2};
        boolean result = check(num);
        if(result){
            System.out.print("有重复的数据");
        }else{
            System.out.println("没有重复的数据");
        }
    }
    private static boolean check(int[] n){
        Arrays.sort(n);
        for(int i = 1; i < n.length; i++){
            if(n[i] == n[i-1]){
                return true;
            }
        }
        return false;
    }
}
